home *** CD-ROM | disk | FTP | other *** search
- #include "ToolSort.h"
-
- /*=========================================================================
- Module: UpdateSel
-
- Purpose: Put seltxt into scrap.
-
- Returns: err
-
- =========================================================================*/
-
- UpdateSel( txt )
- Handle txt; /* text to be placed into scrap */
- {
-
- long len; /* length of txt */
- long err = 0;
-
-
-
- if ( txt != NIL )
- {
- len = GetHandleSize( txt );
- err = ZeroScrap();
- if (err == noErr && len > 0)
- {
- HLock( txt );
- err = PutScrap( len, 'TEXT', *txt );
- HUnlock( txt );
- }
- }
- else
- err = Nil_Hand_Error;
-
- switch( err )
- {
- case noErr:
- if ( len == 0 )
- err = Empty_Error;
- else if ( len < 0 )
- err = Sys_Error;
- break;
- case noScrapErr:
- err = Scrap_Error;
- break;
- case memFullErr:
- err = Memory_Error;
- break;
- default:
- if (err < 0)
- err = Sys_Error;
- }
-
-
-
- return( err );
- }
-